const http = uni.$u.http
function getConfig(config) {
    return {
        ...config,
        header: {
            Accept: 'application/json'
        }
    }
}
// post请求，获取菜单
export default {
    // 获取用户信息
    getUserInfo: (data, config = {}) => http.get('/user/' + data.id),
    updateUser: (data, config = {}) => http.put('/user/' + data.id, data),
    policyDetail: (data, config = {}) => http.get('/policy/' + data.id),

    // 企业登陆、注册
    login: (data, config = {}) => http.post('/user/login', data),
    apply: (data, config = {}) => http.post('/user/apply', data),

    // banner
    getBannerList: (data, config = {}) => http.get('/banner/list', data),
    // news
    getNewsList: (data, config = {}) => http.get('/news/list', data),
    getShipList: (data, config = {}) => http.get('/ship/list', data),
    getShipDetail: (data, config = {}) => http.get('/ship/' + data.id),
    // 船票排期列表
    getShipScheduleList: (data, config = {}) => http.get('/cycle/list', data),
    // 创建订单
    createOrder: (data, config = {}) => http.post('/order', data),
    getOrderList: (data, config = {}) => http.get('/order/list', data),
    refundOrder: (data, config = {}) => http.post('/order/refund', data),
    // 取消订单
    cancelOrder: (data, config = {}) => http.post('/order/cancel', data),
    // 删除订单
    deleteOrder: (data, config = {}) => http.delete('/order/' + data.order_no),

    paymentH5: (data) => http.post('/paymentH5/pay', data),

    // 意见反馈
    feedbackCreate: (data, config = {}) => http.post('/feedback', data),
  // 发票申请
  invoiceCreate: (data, config = {}) => http.post('/invoice', data),
  invoiceAmount: (data, config = {}) => http.get('/invoice/amount', data),
}
